//
//  JoinActivePeopleHeaderView.m
//  Findif
//
//  Created by Mac on 2019/3/7.
//  Copyright © 2019年 Cicel Chen. All rights reserved.
//

#import "JoinActivePeopleHeaderView.h"

@implementation JoinActivePeopleHeaderView

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithReuseIdentifier:reuseIdentifier]) {
        
        [self setupUI];
    }
    return self;
}



- (void)setupUI{
    
    UIView * backView = [UIView new];
    
    backView.backgroundColor  =ZRWhiteColor;
    backView.layer.cornerRadius = 5 * SCREENH6;
    backView.layer.masksToBounds = YES;
    backView.userInteractionEnabled = YES;
    
    self.backView = backView;
    
    [self addSubview:self.backView];
    
    UILabel * titleLabel = [UILabel new];
    
    titleLabel.text = @"报名";
    titleLabel.textColor =ZRBlackColor;
    titleLabel.font = [UIFont systemFontOfSize:15 * SCREENH6];
    
    self.titleLabel = titleLabel;
    
    [self.backView addSubview:self.titleLabel];
    
    
    UILabel * countLabel = [UILabel new];
    
    countLabel.text = @"31人";
    countLabel.textColor = [UIColor lightGrayColor];
    countLabel.font = [UIFont systemFontOfSize:13 * SCREENH6];
    countLabel.textAlignment = NSTextAlignmentRight;
    
    self.countLabel = countLabel;
    
    [self.backView addSubview:self.countLabel];
    
    
    UIView * lineView = [UIView new];
    
    lineView.backgroundColor = ColorWithRGB(0xe4e4e4);
    
    self.lienView = lineView;
    
    [self.backView addSubview:self.lienView];
}

- (void)layoutSubviews{
    
    [self.backView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.centerX.mas_equalTo(self);
        make.width.mas_equalTo(345 * SCREENH6);
        make.height.mas_equalTo(40 * SCREENH6);
    }];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.backView).offset(10 * SCREENH6);
        make.centerY.mas_equalTo(self.backView);
    }];
    
    [self.countLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.trailing.mas_equalTo(self.backView).offset(-10 * SCREENH6);
        make.centerY.mas_equalTo(self.backView);
    }];
    
    [self.lienView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.backView).offset(10 * SCREENH6);
        make.trailing.mas_equalTo(self.backView).offset(-10 * SCREENH6);
        make.bottom.mas_equalTo(self.backView);
        make.height.mas_equalTo(1 * SCREENH6);
    }];
}

@end
